package com.zeny.coding.mapper;


import com.zeny.coding.entity.Course;
import com.zeny.coding.entity.CourseExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CourseMapper {
    long countByExample(CourseExample example);

    int deleteByExample(CourseExample example);

    int deleteByPrimaryKey(String id);

    int insert(Course record);

    int insertSelective(Course record);

    List<Course> selectByExample(CourseExample example);

    Course selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") Course record, @Param("example") CourseExample example);

    int updateByExample(@Param("record") Course record, @Param("example") CourseExample example);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKey(Course record);


    void updateTime(@Param("courseId") String courseId);

    void updateSortForward(@Param("oldSort") Integer oldSort, @Param("newSort") Integer newSort);

    void updateSortBackward(@Param("oldSort") Integer oldSort, @Param("newSort") Integer newSort);

    void updateSort(@Param("courseId") String courseId, @Param("newSort") Integer newSort);

    List<Course> selectCoursesPublishNum(@Param("num") Integer num);

    List<Course> findCoursesByCategoryId(@Param("categoryId") String categoryId);

}